'use strict'

const { port, reqs } = require('./common')
const express = require('../../../versions/express').get()
const cookieParser = require('../../../versions/cookie-parser').get()

const app = express()
app.use(cookieParser())

let connectionsMade = 0

app.get('/', (req, res) => {
  res.writeHead(200)
  res.end('Hello, World!')

  if (++connectionsMade === reqs) {
    server.close()
  }
})

const server = app.listen(port)
